#!/user/bin/env python
# -*- coding: utf-8 -*-
# @Software: PyCharm
# @Time : 2021/08/26 9:47
# @Author : ziqi.zhang
# @Version : 1.0.0
# @Description : 业务层，一系列的Handle集合，组成一整个业务流程

from Handle.BaiduSearch_Handle import BaiduSearchHandle


class BaiduSearchBusiness(object):
    def __init__(self, driver):
        self.BSB = BaiduSearchHandle(driver)

    def search_business(self, key):
        """搜索业务"""
        self.BSB.url()
        self.BSB.search(key)
        self.BSB.search_button()

    def ass(self, searchWork):
        """获取实际结果用作断言"""
        self.search_business(searchWork)
        result_text = self.BSB.result_text()
        return result_text
